<?php

namespace app\admin\controller;
//namespace app\admin\controller;

use think\Controller;
use think\Model;
use think\Request;
use think\Db;

class Login extends Controller
{
    public function index()
    {
        //session_destroy();
		return $this -> fetch();
        //return view();
    }
	
	public function dologin()
	{
		//$map['e_account'] = array('EQ', I('param.a_account', ''));
        //$map['e_password'] = array('EQ', I('param.a_password', ''));
        //$map['e_atpstatus'] = array('EXP', "is null");
        $user = Model('Employee');
        //$result = $Model->where($map)->select();
		$cz = $user -> where(['e_account' => $_POST['a_account'],'e_password' => $_POST['a_password']])->select();
        if (count($cz) == 1) {
			    //当用户是推广人员的时候，只显示推广页
            //session('role', $result[0]['e_role_super']);           
            //session('e_atpid',$result[0]['e_atpid']);
            //session('e_role',$result[0]['e_role']);
            //session('e_account',$result[0]['e_account']);
            //session('e_name',$result[0]['e_name']);
            //session('ip',get_client_ip());
            echo "登录成功";
        } else {
            echo "登录失败";
        }
	}
}

?>